package com.atguigu.lease.web.admin.mapper;

import com.atguigu.lease.model.entity.PaymentType;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author liubo
 * @description 针对表【payment_type(支付方式表)】的数据库操作Mapper
 * @createDate 2023-07-24 15:48:00
 * @Entity com.atguigu.lease.model.PaymentType
 */
public interface PaymentTypeMapper extends BaseMapper<PaymentType> {

    /**
     * 根据id获取支付方式
     * @param id
     * @return
     */
    @Select("select id,name,pay_month_count,additional_info" +
            " from payment_type where " +
            "is_deleted = 0 and id in (" +
            "select payment_type_id from room_payment_type where is_deleted = 0 and room_id = #{id})")
    List<PaymentType> selectListByRoomId(Long id);
}




